package com.jiwei.community.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiwei.community.dao.SectionMapper;
import com.jiwei.community.entity.Section;
import com.jiwei.community.service.SectionService;
import com.jiwei.community.vo.ResponseResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Section)表服务实现类
 *
 * @author jiwei
 * @since 2024-03-20 11:00:01
 */
@Service("sectionService")
public class SectionServiceImpl extends ServiceImpl<SectionMapper, Section> implements SectionService {
    @Resource
    SectionService sectionService;
    @Override
    public ResponseResult getSectionsByCommunityId(Long communityId) {
        LambdaQueryWrapper<Section> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Section::getCommunityId,communityId);
        List<Section> sectionList = sectionService.list(queryWrapper);
        return ResponseResult.okResult(sectionList);
    }
}

